
#ifndef IEnumerator_h
#define IEnumerator_h

// Riccsson includes.
#include <Typedef.h>
#include <Defines.h>
#include <CSharpPropertyMethods.h>

#include <System/Object.h>
#include <System/IDisposable.h>

namespace Riccsson
{
	namespace System
	{
		namespace Collections
		{
			// Summary:
			//     Supports a simple iteration over a generic collection.
			//
			// Type parameters:
			//   T:
			//     The type of objects to enumerate.This type parameter is covariant. That is,
			//     you can use either the type you specified or any type that is more derived.
			//     For more information about covariance and contravariance, see Covariance
			//     and Contravariance in Generics.
			interface IEnumerator //<out T>
				: public IDisposable
				//, IEnumerator
			{
			public:
				PROP3_DEF(IEnumerator, GC_PTR<object>, Current)

				// Constructor need for the CSProperty initialization.
				COPY_CONSTRUCTOR(IEnumerator)
				{
					PROP3_INIT_COPY(IEnumerator, GC_PTR<object>, Current);
				}

				IEnumerator()
					: PROP3_INIT(IEnumerator, Current)
				{
				}

				//virtual IEnumerator(const IEnumerator& other)
				//	: PROP3_INIT(IEnumerator, Current);

				// Summary:
				//     Gets the element in the collection at the current position of the enumerator.
				//
				// Returns:
				//     The element in the collection at the current position of the enumerator.
				//T Current { get; }
				public: virtual PROP3_GET(GC_PTR<object>, Current) = 0;
				private: PROP3_SET(GC_PTR<object>, Current) {};

				//typedef typename IEnumerator<T>::iterator iterator;
				//typedef typename IEnumerator<T>::const_iterator const_iterator;

				// Summary:
				//     Advances the enumerator to the next element of the collection.
				//
				// Returns:
				//     true if the enumerator was successfully advanced to the next element; false
				//     if the enumerator has passed the end of the collection.
				//
				// Exceptions:
				//   System.InvalidOperationException:
				//     The collection was modified after the enumerator was created.
				public: virtual bool MoveNext() = 0;

				//
				// Summary:
				//     Sets the enumerator to its initial position, which is before the first element
				//     in the collection.
				//
				// Exceptions:
				//   System.InvalidOperationException:
				//     The collection was modified after the enumerator was created.
				public: virtual void Reset() = 0;
			};
		}
	}
}

#endif // IENUMERATOR_H